import com.db.gallery.Project
import com.db.gallery.ProjectGroup
import com.db.gallery.ProjectImage
import com.db.home.SliderImage

class BootStrap {

    def init = { servletContext ->
		SliderImage sliderImage
		
		/** Test Data for Image Slider **/
		
		sliderImage = new SliderImage("C:/images/revision/slider/slide1.jpg")
		sliderImage.save();
		
		sliderImage = new SliderImage("C:/images/revision/slider/slide2.jpg")
		sliderImage.save()
		
		sliderImage = new SliderImage("C:/images/revision/slider/slide3.jpg")
		sliderImage.save();
		
		sliderImage = new SliderImage("C:/images/revision/slider/slide4.jpg")
		sliderImage.save();
		
		/*******************************/
		
		/**   Test Data for Gallery   **/
		
		ProjectGroup projectGroup = new ProjectGroup("Kitchen")
		projectGroup.save()
		
		Project project = new Project("Project 1", "Project 1 is my favorite project. I know I should be treating all of my projects equally, but I just can't. Project 1 has significantly more images that any other project. Sure I might have just done this so I could test a project with multiple rows of images, but really it was because I like project 1 more.", projectGroup, "C:/images/revision/projectgroups/Kitchen/Project 1/project1-thumbnail.jpg")
		project.save()
		
		ProjectImage projectImage
		
		projectImage = new ProjectImage(project, "project1image1.jpg", "C:/images/revision/projectgroups/Kitchen/Project 1/images/project1image1.jpg", "C:/images/revision/projectgroups/Kitchen/Project 1/images/project1image1-thumbnail.jpg")
		projectImage.save()
		
		projectImage = new ProjectImage(project, "project1image2.jpg", "C:/images/revision/projectgroups/Kitchen/Project 1/images/project1image2.jpg", "C:/images/revision/projectgroups/Kitchen/Project 1/images/project1image2-thumbnail.jpg")
		projectImage.save()
		
		projectImage = new ProjectImage(project, "project1image3.jpg", "C:/images/revision/projectgroups/Kitchen/Project 1/images/project1image3.jpg", "C:/images/revision/projectgroups/Kitchen/Project 1/images/project1image3-thumbnail.jpg")
		projectImage.save()
		
		projectImage = new ProjectImage(project, "project1image4.jpg", "C:/images/revision/projectgroups/Kitchen/Project 1/images/project1image4.jpg", "C:/images/revision/projectgroups/Kitchen/Project 1/images/project1image4-thumbnail.jpg")
		projectImage.save()
		
		projectImage = new ProjectImage(project, "project1image5.jpg", "C:/images/revision/projectgroups/Kitchen/Project 1/images/project1image5.jpg", "C:/images/revision/projectgroups/Kitchen/Project 1/images/project1image5-thumbnail.jpg")
		projectImage.save()
		
		project = new Project("Project 2", "Some description...", projectGroup, "C:/images/revision/projectgroups/Kitchen/Project 2/project2-thumbnail.jpg")
		project.save()
		
		projectImage = new ProjectImage(project, "project1image1.jpg", "C:/images/revision/projectgroups/Kitchen/Project 2/images/project1image1.jpg", "C:/images/revision/projectgroups/Kitchen/Project 2/images/project1image1-thumbnail.jpg")
		projectImage.save()
		
		project = new Project("Project 3", "Some description...", projectGroup, "C:/images/revision/projectgroups/Kitchen/Project 3/project3-thumbnail.jpg")
		project.save()
		
		projectImage = new ProjectImage(project, "project1image1.jpg", "C:/images/revision/projectgroups/Kitchen/Project 3/images/project1image1.jpg", "C:/images/revision/projectgroups/Kitchen/Project 3/images/project1image1-thumbnail.jpg")
		projectImage.save()
		
		projectGroup = new ProjectGroup("Bathroom")
		projectGroup.save()
		
		project = new Project("Project 1", "Some description...", projectGroup, "C:/images/revision/projectgroups/Bathroom/Project 1/project1-thumbnail.jpg")
		project.save()
		
		projectImage = new ProjectImage(project, "project1image1.jpg", "C:/images/revision/projectgroups/Bathroom/Project 1/images/project1image1.jpg", "C:/images/revision/projectgroups/Bathroom/Project 1/images/project1image1-thumbnail.jpg")
		projectImage.save()
		
		project = new Project("Project 2", "Some description...", projectGroup, "C:/images/revision/projectgroups/Bathroom/Project 2/project2-thumbnail.jpg")
		project.save()
		
		projectImage = new ProjectImage(project, "project1image1.jpg", "C:/images/revision/projectgroups/Bathroom/Project 2/images/project1image1.jpg", "C:/images/revision/projectgroups/Bathroom/Project 2/images/project1image1-thumbnail.jpg")
		projectImage.save()
		
		/*******************************/
    }
	
    def destroy = {
    }
}